import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Stack;


/**
 * Created with IntelliJ IDEA
 * Description:
 * User: YKH
 * Date: 2022-05-11
 * Time: 15:21
 * author:Test01
 */
public class Test01 {
    public static boolean judge(String ch) {
        if( ch.equals("+")||  ch.equals("-") || ch.equals("*") ||  ch.equals("/") ) {
            return false;
        } else {
            return true;
        }
    }
    public static void main(String[] args) {
        String []tokens = {"10","6","9","3","+","-11","*","/","*","17","+","5","+"};
        Stack<Integer> stack = new Stack<>();
        Queue<Integer> queue = new LinkedList<>();
        queue.
        String ch;
        int a = 0;
        int b = 0;
        for( int i=0 ;i < tokens.length ;i++)
        {
            ch = tokens[i];
            if(judge(ch)) {
                stack.push( Integer.parseInt(ch));
            } else {
                a = stack.pop();
                b = stack.pop();
                switch(ch) {
                    case "+":
                         stack.push(a + b);
                        break;
                    case "-":
                        stack.push(a - b);
                        break;
                    case "*":
                        stack.push(a * b);
                        break;
                    case "/":
                        stack.push(a / b);
                        break;
                }
            }
        }
        System.out.println(stack.pop());
    }
}
